package acceptance;

import junit.framework.Assert;




/**
 * @author reut
 * tests different parameters of logout
 * IMPORTANT:in order to work these conditions need to hold:
 *  registered and logged in: username: dani,password:1234
 *  registered and not logged in: username: yosi,password:2222
 */
public class LogoutTest extends ProjectTest
{

	@Override
	public void setUp(){
		super.setUp();
		this._bridge.register("dani", "1234");
		this._bridge.register("yosi", "2222");
		this._bridge.login("dani", "1234");

	}


	/**
	 *  tests when userId is not in the system
	 */
	public void testUserIdNotFoundLogout()
	{
		Assert.assertFalse("userId not found-meaning can't log out", this._bridge.logout(-1));
	}
	/**
	 * tests when user tries to logout when is not logged in first
	 */

	public void testNotLoggedInLogout()
	{
		Assert.assertFalse("not logged in", this._bridge.logout(3));
	}

	/**
	 * tests cases of successful logout
	 */
	public void testCorrectLogout()
	{
		Assert.assertTrue("logged out succssesfuly", this._bridge.logout(2));
	}

}